//=============================================================================
// TFMainMut
//=============================================================================
class TFMainMut extends Mutator
HideDropDown
CacheExempt;

var int ID;

function bool AlwaysKeep(Actor Other)
{
	if ( NextMutator != None )
		return ( NextMutator.AlwaysKeep(Other) );
	return false;
}

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
    local tfbasecore b;

    local vector v;

	if ( Other.IsA('udamagecharger') || Other.IsA('superhealthcharger') || Other.IsA('supershieldcharger')
        || (xWeaponBase(other)!=none && (xWeaponBase(other).WeaponType==class'xWeapons.Redeemer' || xWeaponBase(other).WeaponType==class'xWeapons.Painter')))
	{
        v=other.Location;
	    if(xpickupbase(other)!=none) v.Z+=xPickupBase(other).spawnheight*1.25;

		spawn(class'TaskForces.TFMinerals',,,v);
	}

	if ( Other.IsA('Pickup') || Other.IsA('xPickupBase') )
	{
		Other.bHidden = true;
        Other.Destroy();
        return false;
	}

    if ( Other.IsA('XBombDelivery') )
    {
	    b=spawn(class'TaskForces.TFBaseCore',,,other.location);
        b.setinitialteam(XBombDelivery(other).team);

        Other.bHidden = true;
        return false;
    }
    else if ( Other.IsA('xRealCTFBase') )
    {
	    b=spawn(class'TaskForces.TFBaseCore',,,other.location-xRealCTFBase(other).baseoffset);
	    //base=spawn(class'TaskForces.TFBaseCoreBase',,,other.location-xRealCTFBase(other).baseoffset);
        b.setinitialteam(xRealCTFBase(other).defenderteamindex);
        //base.setinitialteam(xRealCTFBase(other).defenderteamindex);

        Other.bHidden = true;
        return false;
    }

    if( Other.IsA('xBombspawn') )
	{
	    spawn(class'TaskForces.TFMinerals',,,other.location);

        Other.bHidden = true;
        Other.Destroy();
        return false;
    }

	bSuperRelevant = 0;
	return true;
}

defaultproperties
{
     FriendlyName="TASKFORCES - ERROR"
     Description="You really shouldnt see me. Im not here."
}
